package com.harvest.scientific.ladder.net

import BaseResponse
import com.harvest.scientific.ladder.res.AdmireMoreAcheRes
import com.harvest.scientific.ladder.res.ChiefPeperHumourKidRes
import com.harvest.scientific.ladder.res.CombNorthDrawerRes
import com.harvest.scientific.ladder.res.DevelopBothTrainingRs
import com.harvest.scientific.ladder.res.FleeSocialistExpeditionRes
import com.harvest.scientific.ladder.res.MentalDrinkRes
import com.harvest.scientific.ladder.res.QueryProMissRes
import com.harvest.scientific.ladder.res.RegardMostBeehiveRes
import com.harvest.scientific.ladder.res.RememberBlankAntRes
import com.harvest.scientific.ladder.res.SupportGreyMemberRes
import com.harvest.scientific.ladder.util.MapToBodyUtil
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import java.io.File


class ReRsitory: BaRsitory() {

    suspend fun delayViolentTheir(
        crazyShaverStrengthTyre: String,
        file: File
    ): BaseResponse<String?> {
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["crazyShaverStrengthTyre"] = crazyShaverStrengthTyre
        map["neatSoupPunctualJournalist"] = file
        val requestBodyMap = MapToBodyUtil.getRequestBodyMap(map)
        return handleRequest {
            baseService.delayViolentTheir(
                requestBodyMap
            ).toRespObj(String::class.java)
        }
    }

    suspend fun developBothTraining(
        uselessElectricAnimal: String?,
    ): BaseResponse<DevelopBothTrainingRs?> {
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["uselessElectricAnimal"] = uselessElectricAnimal ?: ""
        return handleRequest {
            baseService.developBothTraining(
                map,
            ).toRespObj(DevelopBothTrainingRs::class.java)
        }
    }

    suspend fun supportGreyMember(
        uselessElectricAnimal: String,
        moreStillThemeArmy:String
    ): BaseResponse<SupportGreyMemberRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["uselessElectricAnimal"] = uselessElectricAnimal
        map["moreStillThemeArmy"] = moreStillThemeArmy
        map["asianEarlySoldierRegularPedestrian"] = "00000000-0000-0000-0000-000000000000"
        map["safeAdvantageLiquidTankTree"] = "00000000000000000000000000000000"
        map["dampHeroineKilogram"] = ""
        return handleRequest {
            baseService.supportGreyMember(
                map,
            ).toRespObj(SupportGreyMemberRes::class.java)
        }
    }

    suspend fun easeIncorrectFibre(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.easeIncorrectFibre(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun shakeLivelySofa(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.shakeLivelySofa(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun fleeSocialistExpedition(
        mexicanRegardsMistakenRoofInterestingGallery: Int
    ): BaseResponse<FleeSocialistExpeditionRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        return handleRequest {
            baseService.fleeSocialistExpedition(
                map,
            ).toRespObj(FleeSocialistExpeditionRes::class.java)
        }
    }

    suspend fun rememberBlankAnt(
        crazyShaverStrengthTyre: String
    ): BaseResponse<List<RememberBlankAntRes>>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["crazyShaverStrengthTyre"] = crazyShaverStrengthTyre
        return handleRequest {
            baseService.rememberBlankAnt(
                map,
            ).toRespArray(RememberBlankAntRes::class.java)
        }
    }

    suspend fun regardMostBeehive(
        femaleRecorderDrum:String = "-1",
        troublesomeDisappointmentHugePostcodeReasonableSpade: String = "1"
    ): BaseResponse<List<RegardMostBeehiveRes>>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["femaleRecorderDrum"] = femaleRecorderDrum
        map["troublesomeDisappointmentHugePostcodeReasonableSpade"] = troublesomeDisappointmentHugePostcodeReasonableSpade
        return handleRequest {
            baseService.regardMostBeehive(
                map,
            ).toRespArray(RegardMostBeehiveRes::class.java)
        }
    }

    suspend fun tasteCottonDeal(

    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()

        return handleRequest {
            baseService.tasteCottonDeal(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun industryThankfulKid(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.industryThankfulKid(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun realiseArabPrescription1(
        mexicanRegardsMistakenRoofInterestingGallery: Int,
        festivalPaper: String,
        suddenGasTwin: String,
        unsuccessfulFavouriteEmbassy: String,
        southRecordSureSleeve: String,
        actualStreamColdVinegar: String,
        furnishedSink: String,
        indeedSoccerUsefulGuest: String,
        greyShineContributionCar: String,
        solidThereLake: String,
        roundExerciseTroublesomeStranger: String,
        thinFriendCoolTastelessQuilt: String,
        allInternetSailingAgriculturalTiger: String,
        rapidNobleBestBacon: String,
        considerateHungerTomato: String,
    ): BaseResponse<Any?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        map["festivalPaper"] = festivalPaper
        map["suddenGasTwin"] = suddenGasTwin
        map["unsuccessfulFavouriteEmbassy"] = unsuccessfulFavouriteEmbassy
        map["southRecordSureSleeve"] = southRecordSureSleeve
        map["actualStreamColdVinegar"] = actualStreamColdVinegar
        map["furnishedSink"] = furnishedSink ?: ""
        map["indeedSoccerUsefulGuest"] = indeedSoccerUsefulGuest
        map["greyShineContributionCar"] = greyShineContributionCar
        map["solidThereLake"] = solidThereLake
        map["roundExerciseTroublesomeStranger"] = roundExerciseTroublesomeStranger
        map["thinFriendCoolTastelessQuilt"] = thinFriendCoolTastelessQuilt
        map["allInternetSailingAgriculturalTiger"] = allInternetSailingAgriculturalTiger
        map["rapidNobleBestBacon"] = rapidNobleBestBacon
        map["considerateHungerTomato"] = considerateHungerTomato
        return handleRequest {
            baseService.realiseArabPrescription(
                map,
            ).toRespObj(Any::class.java)
        }
    }

    suspend fun realiseArabPrescription2(
        mexicanRegardsMistakenRoofInterestingGallery: Int,
        standardInternationalCrossroads: String,
        sleepyElectricBotanySatellite: String,
        compressedAnybodyPyramid: String,
        usedSuccess: String,
        mistakenPlayroomHardworkingPorterSalesgirl: String,
        afraidQuarterShow: String,
    ): BaseResponse<Any?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        map["standardInternationalCrossroads"] = standardInternationalCrossroads
        map["sleepyElectricBotanySatellite"] = sleepyElectricBotanySatellite
        map["compressedAnybodyPyramid"] = compressedAnybodyPyramid
        map["usedSuccess"] = usedSuccess
        map["mistakenPlayroomHardworkingPorterSalesgirl"] = mistakenPlayroomHardworkingPorterSalesgirl
        map["afraidQuarterShow"] = afraidQuarterShow
        return handleRequest {
            baseService.realiseArabPrescription(
                map,
            ).toRespObj(Any::class.java)
        }
    }

    suspend fun realiseArabPrescription3(
        mexicanRegardsMistakenRoofInterestingGallery: Int,
        terminalNeckHomelandPartner: String,
    ): BaseResponse<Any?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        map["terminalNeckHomelandPartner"] = terminalNeckHomelandPartner
        return handleRequest {
            baseService.realiseArabPrescription(
                map,
            ).toRespObj(Any::class.java)
        }
    }

    suspend fun combNorthDrawer(
        mexicanRegardsMistakenRoofInterestingGallery: String
    ): BaseResponse<List<CombNorthDrawerRes>>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        return handleRequest {
            baseService.combNorthDrawer(
                map,
            ).toRespArray(CombNorthDrawerRes::class.java)
        }
    }

    suspend fun uniteDangerousMineral(
        anotherSkillfulPatternBathtub: String,
        technicalBigMealLoad: String,
        nationalStandNoisyClothSecondhand: String
    ): BaseResponse<Any?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["anotherSkillfulPatternBathtub"] = anotherSkillfulPatternBathtub
        map["technicalBigMealLoad"] = technicalBigMealLoad
        map["nationalStandNoisyClothSecondhand"] = nationalStandNoisyClothSecondhand
        return handleRequest {
            baseService.uniteDangerousMineral(
                map,
            ).toRespObj(Any::class.java)
        }
    }

    suspend fun practiseCheapDocument(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.practiseCheapDocument(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun exploitBlindEurope(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.exploitBlindEurope(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun hookUndividedVisitor(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.hookUndividedVisitor(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun bringUsefulSculpture(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.bringUsefulSculpture(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun awakeUndividedSong(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.awakeUndividedSong(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun admireMoreAche(
        mexicanRegardsMistakenRoofInterestingGallery: String
    ): BaseResponse<AdmireMoreAcheRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map["mexicanRegardsMistakenRoofInterestingGallery"] = mexicanRegardsMistakenRoofInterestingGallery
        return handleRequest {
            baseService.admireMoreAche(
                map,
            ).toRespObj(AdmireMoreAcheRes::class.java)
        }
    }

    suspend fun eatSouthernCamel(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.eatSouthernCamel(
                map,
            ).toRespObj(String::class.java)
        }
    }

    suspend fun rewriteFavouriteDog(
    ): BaseResponse<String?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.rewriteFavouriteDog(
                map,
            ).toRespObj(String::class.java)
        }
    }
    suspend fun missHungryFirewood(
    ): BaseResponse<QueryProMissRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        return handleRequest {
            baseService.missHungryFirewood(
                map,
            ).toRespObj(QueryProMissRes::class.java)
        }
    }
    suspend fun mentalDrinkDryerDouble(
        usefulTailChocolate: Int , thirstyHousewifeBoxTomato: Int , badShoulderLamb: String
    ): BaseResponse<MentalDrinkRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map.run {
            put("usefulTailChocolate", usefulTailChocolate)
            put("thirstyHousewifeBoxTomato", thirstyHousewifeBoxTomato)
            put("badShoulderLamb", badShoulderLamb)
        }
        return handleRequest {
            baseService.mentalDrinkDryerDouble(
                map,
            ).toRespObj(MentalDrinkRes::class.java)
        }
    }

    suspend fun chiefPepperHumourKid(
        usefulTailChocolate: Int , thirstyHousewifeBoxTomato: Int , badShoulderLamb: String
    ): BaseResponse<ChiefPeperHumourKidRes?>{
        val map: MutableMap<String, Any> = ComParams.getCommonParams().toMutableMap()
        map.run {
            put("usefulTailChocolate", usefulTailChocolate)
            put("thirstyHousewifeBoxTomato", thirstyHousewifeBoxTomato)
            put("badShoulderLamb", badShoulderLamb)
        }
        return handleRequest {
            baseService.chiefPepperHumourKid(
                map,
            ).toRespObj(ChiefPeperHumourKidRes::class.java)
        }
    }

    suspend fun greetMerryRabbit(
        bodyStr: String
    ): BaseResponse<String?>{
        return handleRequest {
            baseService.greetMerryRabbit(
                bodyStr.toRequestBody("text/plain".toMediaType())
            ).toRespObj(String::class.java)
        }
    }
}